<!-- 综合查询/账户余额 -->
<template>
  <div style="padding: 15px">
    <vxe-toolbar
      id="warehouseLocationId"
      :custom="{ storage: true }"
      export
      :refresh="{ query: findList }"
    >
    </vxe-toolbar>
    <vxe-table
      ref="xTable"
      border
      resizable
      :export-config='{type:"csv"}'
      stripe
      highlight-current-row
      align="center"
      show-footer
      highlight-hover-row
      row-id="id"
      height="700"
      :loading="loading"
      :data="tableData"
      sort-config.remote
      auto-resize
    >
      <vxe-table-column type="seq" width="60" fixed="left"/>
      <vxe-table-column type="checkbox" width="60" fixed="left"/>
      <vxe-table-column field="groupName" title="组织机构"/>
      <vxe-table-column field="serialNumber" title="组织编码"/>
      <vxe-table-column field="times" title="充值数量"/>
      <vxe-table-column field="uses" title="使用数量"/>
      <vxe-table-column field="surplus" title="剩余数量"/>
      <vxe-table-column field="action" title="操作" width="120" fixed="right">
        <template slot-scope="scope">
          <el-tooltip class="item" content="详情" placement="top">
            <vxe-button type="text" icon="el-icon-tickets" @click="funcRiview(scope.row.groupCode)"/>
          </el-tooltip>
        </template>
      </vxe-table-column>
    </vxe-table>
    <vxe-modal v-model="modelFlang" title="详情" width="800" height="600" resize destroy-on-close>
      <compDel :code='code'/>
    </vxe-modal>
  </div>
</template>
<script>
import compDel from './components/detail.vue'
import request from '@/utils/request'

export default {
  name: 'AccountBalance',
  components:{ compDel },
  data() {
    return {
      code:'',
      loading: false,
      modelFlang: false,
      tableData: [],
      listQuery: {
        total: 0, //总数
        pageNum: 1,
        pageSize: 100,
      },
    };
  },
  created() {
    this.findList()
  },
  methods: {
    findList(){
      this.loading = true
      return new Promise(resolve=>{
        request({
          url: '/wms/outbound/accountBalance',
          method: 'put'
        }).then(res => {
          this.tableData = res.data
          resolve()
        }).finally(()=>{
          this.loading = false
        })
      })
    },
    funcRiview(val){
      this.modelFlang = true
      this.code = val
    },
  }
}
</script>
